<template>
	<div class="layout-main">
		<div class="section section-table">
			<div class="section section-filter">			
				<div class="panel-content">
					<el-form ref="filterData" :inline="true" :model="filterData">
						 <el-date-picker v-model="date" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期">
					    </el-date-picker>
						<div class="el-form-item item-txt sub-open">总打开：<span>210</span></div>
						<div class="el-form-item item-txt risk">风险占比：<span>1920（80%）</span></div>
					</el-form>
				</div>
			</div>
			<div class="panel-content">
				<div class="bread-btns">
					<router-link class='btn bread-btn' :to="{path: '/manage/share'}">分享设置</router-link>
				</div>
				<el-table border :data="tableData.data" style="width: 100%">
					<el-table-column resizable='false' width='80px' label="" prop="index"></el-table-column>
					<el-table-column resizable='false' label="标题" prop="update"></el-table-column>
					<el-table-column resizable='false' label="播放" prop="update"></el-table-column>
					<el-table-column resizable='false' width='分享' label="状态" prop="update"></el-table-column>
				</el-table>
			</div>
		</div>
		<!-- 取消提案 -->
		<layer :data="cencalLayer" @on-ok="cancelApplyLayer"></layer>
	</div>
</template>
<script>	
	import { TreeToArray } from '@/utils'
	import '@/assets/less/modules/switch.less'
	import '@/assets/less/modules/date-picker.less'
	export default {
		data() {
			return {
				//当前登录用户
				clueId: '',				
				// 角色列表
				roleList: [],
				roleForm: {
					name: ''
				},
				targetActive: true,
				targetForm: {
					id: 0
				},
				superiorUser: [],
				cencalLayer: {
					title: '取消提案',
					show: false,
					tips: '确定取消提案？'
				},
				date: '',
				tableData :{
					data:[{
						index: '分享一',
						id:1,
						name:'震惊!中兴或失去谷歌的Android系统授权',
						update: '2018-4-20  20:07:49'
					}]
				}
			}
		},
		mounted() {
			this.$store.commit('breadData', {
				pageName:'微信开发平台设置',				
				list:[
					{
						name: '项目列表'
					}
				]
			})
		},		
		methods: {
			copy() {
				
			},
			reset() {

			},
			// 弹窗-提案申请
			showApplyLayer(id) {	
				this.applyInfo.data = {}
				this.applyInfo.data.id = id
				this.applyInfo.show = true

				this.roleForm = {}
				this.targetForm = {}
				this.superiorUser = []				
			},			
			// 取消提案
			showCancelApplyLayer(id) {
				this.cencalLayer.show = true
				this.clueId = id
			},
			cancelApplyLayer(id) {
				api.cancelClue({ id: this.clueId }).then(res => {
					if (res == 'success') {
						this.$msg({ message: '取消提案成功', type: 'success' })
						this.sumbitSave()
						this.cencalLayer.show = false
						this.$store.dispatch('getUnProcess')
					}
				}).catch(res => {
					console.log(res)
				})
			}

		}
	}
</script>